{include file="public/layout" /}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 
<span class="c-gray en">&gt;</span> 权限管理
<span class="c-gray en">&gt;</span> 添加管理员
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i>
</a>
</nav>
<article class="page-container" style="margin-top: 50px;">
    <form class="form form-horizontal" id="form-admin-add" action="{:url('Admin/admin/adminHandle')}" method="post">
    <input type="hidden" name="act" value="{$act}">
    <input type="hidden" name="admin_id" value="{$info.admin_id ? $info.admin_id : '' }">
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>管理员：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" name="user_name" value="{$info.user_name ? $info.user_name : ''}" id="user_name" style="width: 60%;">
        </div>
    </div>
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>登陆密码：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="password" class="input-text" name="password" value="{$info.password ?  $info.password : ''}" id="password" style="width: 60%;">
        </div>
    </div>
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" placeholder="@" name="email" value="{$info.email ? $info.email : ''}" id="email" style="width: 60%;">
        </div>
    </div>
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3">角色：</label>
        <div class="formControls col-xs-8 col-sm-9"> <span class="select-box" style="width:150px;">
            <select name="role_id" class="select" size="1">
                {volist name="role" id="item"}
                    <option value="{$item.role_id}" {if isset($info.role_id) && $item.role_id == $info.role_id} selected="selected" {/if} >{$item.role_name ?  $item.role_name : ''}</option>
                {/volist}
            </select>
            </span> 
        </div>
    </div>
    <div class="row cl">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
            <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;
             <input class="btn btn-success radius" type="button" value="&nbsp;&nbsp;返回上一页&nbsp;&nbsp;" onclick="javascript:history.go(-1);">
        </div>
    </div>
    </form>
</article>
{include file="public/footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/public/h-ui.admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/public/h-ui.admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/public/h-ui.admin/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    
    $("#form-admin-add").validate({
        rules:{
            user_name:{
                required:true,
                minlength:4,
                maxlength:16
            },
            password:{
                required:true,
            },
            email:{
                required:true,
                email:true,
            },
            role_id:{
                required:true,
            },
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
    });
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>